<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>天天生鲜-商品列表</title>
	<link rel="stylesheet" type="text/css" href="/static/css/reset.css">
	<link rel="stylesheet" type="text/css" href="/static/css/main.css">
    <script type="text/javascript" src="/static/js/jquery-1.12.4.min.js"></script>
	<script type="text/javascript" src="/static/js/jquery-ui.min.js"></script>
	<script type="text/javascript" src="/static/js/slide.js"></script>
</head>

<body>
	<div class="header_con">
		<div class="header">
			<div class="welcome fl">欢迎来到天天生鲜!</div>
			<div class="fr">

				{% if request.session.user_names %}
                    <div class="login_info fl">
					欢迎您：<em>{{ request.session.user_names }}</em>
                    <a href="/logout/">退出</a>
				    </div>
                    <div class="user_link fl">
					<span>|</span>
					<a href="/user_center_info/">用户中心</a>
					<span>|</span>
					<a href="/cart/">我的购物车</a>
					<span>|</span>
					<a href="/user_center_order/">我的订单</a>
				    </div>
                {% else %}
                    <div class="login_btn fl">
					<a href="/login/">登录</a>
					<span>|</span>
					<a href="/register/">注册</a>
				    </div>
                {% endif %}
			</div>
		</div>		
	</div>

	<div class="search_bar clearfix">
		<a href="/" class="logo fl"><img src="/static/images/logo.png"></a>
		<div class="search_con fl">
			<form action="/search/" method="get" target="_blank">
			<input type="text" class="input_text fl" name="q" placeholder="搜索商品">
			<input type="submit" class="input_btn fr" name="" value="搜索">
            </form>
		</div>
		<div class="guest_cart fr">
			<div class="guest_cart fr">
			<a href="/cart/" class="cart_name fl">我的购物车</a>
			<div class="goods_count fl" id="show_count"> </div>
		</div>
	</div>
        <script>
            if ('{{ request.session.user_id}}') {
                //如果用户登录了
                $.get('/cart/count/', function (data) {
                    $('#show_count').html(data.count);
                })
            }
        </script>

		</div>

	</div>


	<div class="navbar_con">
		<div class="navbar clearfix">
			<div class="subnav_con fl">
				<h1>全部商品分类</h1>	
				<span></span>			
				<ul class="subnav">
					<li><a href="/lists1_1_0/" class="fruit">新鲜水果</a></li>
					<li><a href="/lists2_1_0/" class="seafood">海鲜水产</a></li>
					<li><a href="/lists3_1_0/" class="meet">猪牛羊肉</a></li>
					<li><a href="/lists4_1_0/" class="egg">禽类蛋品</a></li>
					<li><a href="/lists5_1_0/" class="vegetables">新鲜蔬菜</a></li>
					<li><a href="/lists6_1_0/" class="ice">速冻食品</a></li>
				</ul>
			</div>
			<ul class="navlist fl">
				<li><a href="/">首页</a></li>
				<li class="interval">|</li>
				<li><a href="">手机生鲜</a></li>
				<li class="interval">|</li>
				<li><a href="">抽奖</a></li>
			</ul>
		</div>
	</div>

	<div class="breadcrumb">
		<a href="#">全部分类</a>
		<span>></span>
		<a href="#">新鲜水果</a>
	</div>

	<div class="main_wrap clearfix">
		<div class="l_wrap fl clearfix">
			<div class="new_goods">
				<h3>新品推荐</h3>
				<ul>
					<li>
						<a href="/detail_1/"><img src="/static/images/goods/goods001.jpg"></a>
						<h4><a href="#">进口柠檬</a></h4>
						<div class="prize">￥3.90</div>
					</li>
					<li>
						<a href="/detail_2/"><img src="/static/images/goods/goods002.jpg"></a>
						<h4><a href="#">玫瑰香葡萄</a></h4>
						<div class="prize">￥16.80</div>
					</li>
				</ul>
			</div>
		</div>

		<div class="r_wrap fr clearfix">
			<div class="sort_bar">
{#				<a href="/lists_{{ type_info.id }}_{{ page.number }}_0" class="active">默认</a>#}
{#				<a href="/lists_{{ type_info.id }}_{{ page.number }}_1" >价格</a>#}
{#				<a href="/lists_{{ type_info.id }}_{{ page.number }}_2" >人气</a>#}
                <a href="/list{{ type.id }}_{{ page.number }}_0" {% if ord == '0' %}class="active" {% endif %}>默认</a>
{#              <a href="/list{{ type.id }}_{{ page.number }}_3" {% if ord == '3' %}class="active" {% endif %}>默认</a>#}
                <a href="/list{{ type.id }}_{{ page.number }}_1" {% if ord == '1' %}class="active" {% endif %}>价格</a>
{#              <a href="/list{{ type.id }}_{{ page.number }}_4" {% if ord == '4' %}class="active" {% endif %}>价格</a>#}
                <a href="/list{{ type.id }}_{{ page.number }}_2" {% if ord == '2' %}class="active" {% endif %}>人气</a>
{#        <a href="/list{{ type.id }}_{{ page.number }}_5" {% if ord == '5' %}class="active" {% endif %}>人气</a>#}

			</div>

        {% block contents %}
        <ul class="goods_type_list clearfix">
            <div class="sorts">
{#            {% for g in page.object_list %}#}
{#				<li>#}
{#					<a href="/detail_{{ g.id }}/"><img src="/static/{{ g.gpic }}"></a>#}
{#					<h4><a href="#">{{ g.gtitle }}</a></h4>#}
{#					<div class="operate">#}
{#						<span class="prize">￥{{ g.gprice }}</span>#}
{#						<span class="unit">{{ g.gunit}}</span>#}
{#						<a href="/list_{{ g.id }}_{{ type_info.id }}_{{ page.number }}/" class="add_goods" title="加入购物车"></a>#}
{#					</div>#}
{#				</li>#}
{#            {% endfor %}#}
                {% for g in page.object_list %}
            <li>
                <a href="/detail_{{ g.id }}/"><img src="/static/{{ g.gpic }}"></a>
                <h4><a href="/{{ g.id }}">{{ g.gtitle }}</a></h4>
                <div class="operate">
                    <span class="prize">￥{{ g.gprice }}</span>
                    <span class="unit">{{ g.gprice }}/{{ g.gunit }}</span>
                    <a href="#" class="add_goods" title="加入购物车" name="{{ g.id }}"></a>
                </div>
            </li>
        {% endfor %}
            </div>
        </ul>
        {% endblock %}

        <div class="pagenation">
        {% if page.has_previous %}
				<a href="/lists{{ type.id }}_{{ page.previous_page_number }}_0/">上一页</a>
        {% endif %}

                {% for page in page.paginator.page_range %}
                    {% if page == page.number %}
                        <a href="#" class="active">{{ page }}</a>
                    {% else %}
                        <a href="/lists{{ type.id }}_{{ page }}_0/" >{{ page }}</a>
                    {% endif %}

                {% endfor %}
            {% if page.has_next%}
                <a href="/lists{{ type.id }}_{{ page.next_page_number }}_0/">下一页></a>
            {% endif %}

			</div>
		</div>
	</div>

	<div class="footer">
		<div class="foot_link">
			<a href="#">关于我们</a>
			<span>|</span>
			<a href="#">联系我们</a>
			<span>|</span>
			<a href="#">招聘人才</a>
			<span>|</span>
			<a href="#">友情链接</a>		
		</div>
		<p>CopyRight © 2016 北京天天生鲜信息技术有限公司 All Rights Reserved</p>
		<p>电话：010-****888    京ICP备*******8号</p>
	</div>
	
</body>
</html>